﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace OAuth
{
    public static class OAuthUtility
    {
        //
        // Parse an HTTP response into a dictionary
        //
        public static Dictionary<string, string> ParseHttpResponseIntoDictionary(string response)
        {
            var dictionary = new Dictionary<string, string>();

            if (response == "")
            {
                return dictionary;
            }

            var arguments = response.Split('&');

            foreach (var a in arguments.Select(a => a.Split('=')))
            {
                dictionary.Add(a[0], a[1]);
            }

            return dictionary;
        }


    }

}
